package com.chrray.position.domain;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.chrray.position.enums.YesNoEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.*;
import java.util.Date;
import java.util.List;

/**
 * 用户工作经历表 对象
 *
 * @author wusiwee
 * @email wusiwee@163.com
 * @since 1.0.1 2024-08-07
 */

@Data
@ApiModel(description = "用户工作经历表")
@TableName("fd_work_experience")
public class FdWorkExperience extends Model<FdWorkExperience> {
	@ApiModelProperty(value = "主键")
	@TableId(type = IdType.AUTO)
	private Long id;

	@ApiModelProperty(value = "用户id")
	private Long userId;

	@ApiModelProperty(value = "工作职位")
	private String jobPosition;

	@ApiModelProperty(value = "工作开始年份")
	private Integer startYear;

	@ApiModelProperty(value = "工作结束年份")
	private Integer endYear;

	@ApiModelProperty(value = "公司名称")
	private String companyName;

	@ApiModelProperty(value = "排序")
	private Integer sort;

	private Date createTime;

	private Integer delFlag;

    public static List<FdWorkExperience> findByUserId(Long userId) {
		LambdaQueryWrapper<FdWorkExperience> queryWrapper = new LambdaQueryWrapper<>();
		queryWrapper.eq(FdWorkExperience::getUserId, userId);
		return new FdWorkExperience().selectList(queryWrapper);
    }
}
